﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Acme.BookStore2.Migrations
{
    public partial class vehicleadd : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AppVehicleInspectionRecord_AppVehicle_VehicleId",
                table: "AppVehicleInspectionRecord");

            migrationBuilder.DropColumn(
                name: "Logo",
                table: "AppVehicle");

            migrationBuilder.AddColumn<Guid>(
                name: "TenantId",
                table: "VehicleRepairRecords",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "TenantId",
                table: "VehicleMaintenanceRecords",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "TenantId",
                table: "VehicleDriveRecords",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Partner",
                table: "AppVehicle",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "PurchasingDate",
                table: "AppVehicle",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "VehicleType",
                table: "AppVehicle",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "VehicleYear",
                table: "AppVehicle",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "TenantId",
                table: "VehicleRepairRecords");

            migrationBuilder.DropColumn(
                name: "TenantId",
                table: "VehicleMaintenanceRecords");

            migrationBuilder.DropColumn(
                name: "TenantId",
                table: "VehicleDriveRecords");

            migrationBuilder.DropColumn(
                name: "Partner",
                table: "AppVehicle");

            migrationBuilder.DropColumn(
                name: "PurchasingDate",
                table: "AppVehicle");

            migrationBuilder.DropColumn(
                name: "VehicleType",
                table: "AppVehicle");

            migrationBuilder.DropColumn(
                name: "VehicleYear",
                table: "AppVehicle");

            migrationBuilder.AddColumn<string>(
                name: "Logo",
                table: "AppVehicle",
                type: "varchar(128) CHARACTER SET utf8mb4",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_AppVehicleInspectionRecord_AppVehicle_VehicleId",
                table: "AppVehicleInspectionRecord",
                column: "VehicleId",
                principalTable: "AppVehicle",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
